import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    component: () => import('../pages/login')
  },
  {
    path: '*',
    redirect:'/login'
  },
  {
    path: '/index',
    component: () => import('../pages/index'),
    children:[
      {
        path: '/home',
        component: () => import('../views/home'),
      },
      {
        path: '/menu',
        component: () => import('../views/menu/index'),
      },
      {
        path: '/maner',
        component: () => import('../views/user/index'),
      },
      {
        path: '/roler',
        component: () => import('../views/roler/index'),
      },
      {
        path: '/cate',
        component: () => import('../views/cate/index'),
      },
      {
        path: '/specs',
        component: () => import('../views/specs/index'),
      },
      {
        path: '/goods',
        component: () => import('../views/goods/index'),
      },
      {
        path: '/banner',
        component: () => import('../views/banner/index'),
      },
      {
        path: '/member',
        component: () => import('../views/member/index'),
      },
      {
        path: '/seckill',
        component: () => import('../views/seckill/index'),
      },
      {
        path: '',
        redirect:'/home'
      },
    ],
  }
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
